package com.kitty.game.pay.facade;

import com.kitty.common.utils.SpringUtils;
import com.kitty.game.role.model.Role;
import com.kitty.game.role.service.PayService;
import com.kitty.listener.EventType;
import com.kitty.listener.annotation.EventHandler;
import com.kitty.listener.event.PaySuccessEvent;
import org.springframework.stereotype.Controller;

@Controller
public class PayOrderController {
    @EventHandler(EventType.PAY_SUCESS)
    public void handlePaySucess(PaySuccessEvent paySuccessEvent) {
        Role role = paySuccessEvent.getRole();
        SpringUtils.getBean(PayService.class).handleAccumulativeReward(role, paySuccessEvent.getMoney(), paySuccessEvent.getAddGold());
        //SpringUtils.getBean(FirstPayRewardHandler.class).handleFirstPay(role, paySuccessEvent.getMoney(), paySuccessEvent.getAddGold());
    }
}
